package com.platform.common.authentication.stateless;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.shiro.authc.AuthenticationToken;

/**
 * 无状态认证token
 * <p>
 * @description:
 * @author: WangYang
 * @date: 2017-09-28 14:34
 */
@Data
@AllArgsConstructor
public class StatelessToken implements AuthenticationToken {

    @Accessors(chain = true)
    private String id;
    @Accessors(chain = true)
    private String token;

    @Override
    public Object getPrincipal() {
        return this.id;
    }

    @Override
    public Object getCredentials() {
        return this.token;
    }
}
